<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
    <title></title>

    <link rel="stylesheet" href="http://js.arcgis.com/3.13/dijit/themes/nihilo/nihilo.css">
    <link rel="stylesheet" href="http://js.arcgis.com/3.13/esri/css/esri.css">
    <style>
      html, body, #map { 
        height: 100%; width: 100%;
        margin: 0; padding: 0;
      } 
      body{
        background-color: #fff; overflow:hidden; 
        font-family: sans-serif;
      } 
    </style>

    <script>
    var dojoConfig = {
      parseOnLoad:true,
      packages: [{
        "name": "myModules",
        "location": "http://localhost:8080" + "/myModules"
      }]
    };
    console.debug(dojoConfig.packages)
    </script>
    <script src="http://js.arcgis.com/3.13/"></script>
    <script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
    <script>
      var map;
      var gl;
      var add;
      require([
        "esri/map",
        "myModules/BaiduLayer",
        "myModules/TDTLayer",
        "myModules/TDTAnnoLayer",
        "esri/layers/WebTiledLayer",
        "esri/layers/ArcGISTiledMapServiceLayer",
        "esri/layers/GraphicsLayer",
        "esri/graphic",
        "esri/geometry/Point",
        "esri/symbols/PictureMarkerSymbol",
        "esri/geometry/webMercatorUtils",
        "dojo/parser",
        "dojo/domReady!"
      ], function(
        Map,
        BaiduLayer,
        TDTLayer,
        TDTAnnoLayer,
        WebTiledLayer,
        ArcGISTiledMapServiceLayer,
        GraphicsLayer,
        Graphic,
        Point,
        PictureMarkerSymbol,
        webMercatorUtils,
        parser
      ) {
    	var markerSymbol = new PictureMarkerSymbol({"angle":0,"xoffset":0,"yoffset":0,"type":"esriPMS","url":"http://static.arcgis.com/images/Symbols/Shapes/BlueCircleLargeB.png","imageData":"iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAADImlUWHRYTUw6Y29tLmFkb2Jl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uIGJvfwuI3FnRyCz/keP+MxA/5FZriLjcYA2L87A2GUwRIhqBDCvPb+k9S3IW0/drQpYKQ8RnzedxqA4V78QThu2GbxIJAZyXcMBmAkUXuYzgkq4GHK5ki4BBUwkqg9TOeMeQV8A+PZBskD6qdKAAAAAElFTkSuQmCC","contentType":"image/png","width":24,"height":24});
    	
    	  
        map = new Map("map",{sliderStyle:"large"});
        /*
        var cycleMap = new WebTiledLayer("http://${subDomain}.tile.opencyclemap.org/cycle/${level}/${col}/${row}.png", {
          "copyright": "Open Cycle Map",
          "id": "Open Cycle Map",
          "subDomains": ["a", "b", "c"]
        });*/
        var baidulayer=new BaiduLayer();
        map.addLayer(baidulayer);
//         var basemap = new TDTLayer();  
//         map.addLayer(basemap); 
//         var annolayer = new TDTAnnoLayer();  
//         map.addLayer(annolayer);
        
        $.ajax({
           url: "data.json",
           method:"get",
           dataType: "json",
           error:function (XMLHttpRequest, textStatus, errorThrown) {
             alert("请求错误");
           },
           success: function (data, textStatus) {
        	  var spatialReference=map.spatialReference;
        	  gl=new GraphicsLayer();
        	  gl.id="gl";
       	      $.each(data, function(index, value) {
       	          if($.isNumeric(value.latitude)&&$.isNumeric(value.latitude)){
       	            //
       	            //var mercator=webMercatorUtils.lngLatToXY(value.longitude, value.latitude);
       	            //console.debug(mercator);
       	            var point = new Point(value.longitude,value.latitude);
       	            gl.add(new Graphic(point,markerSymbol,value));
       	          }
       	      });
       	      map.addLayer(gl);
           }
         });
        
        
        function addLayer(){
        	var tiledMapServiceLayer = new ArcGISTiledMapServiceLayer("http://cache1.arcgisonline.cn/ArcGIS/rest/services/ChinaOnlineStreetColor/MapServer",{opacity:0.5});
            map.addLayer(tiledMapServiceLayer);
        }
        add=addLayer;
      });
      
      
    </script>
  </head>
  <body class="nihilo">
      <div id="map">
      </div>
  </body>
</html>

